package com.chengyu.core.service.services;

import com.chengyu.core.domain.form.ServicesImportForm;
import com.chengyu.core.domain.form.ServicesPublishForm;
import com.chengyu.core.domain.form.ServicesSearchForm;
import com.chengyu.core.domain.result.ServicesExportResult;
import com.chengyu.core.domain.result.ServicesResult;
import com.chengyu.core.domain.result.ServicesSkuResult;
import com.chengyu.core.domain.result.ServicesStockResult;
import com.chengyu.core.exception.ServiceException;
import com.chengyu.core.model.PmsServices;
import com.chengyu.core.model.PmsServicesGroup;
import com.chengyu.core.model.PmsServicesSku;
import com.chengyu.core.model.UmsShop;

import java.util.List;

/**
 * @title  商品
 * @author wenlj
 * @date   2023/10/03
 */
public interface ServicesService {

	/**
	 * 商品列表
	 * @author wenlj
	 * @date   2023/10/03
	 * @param  form
	 * @param  page
	 * @param  pageSize
	 * @return List<PmsServices>
	 */
	List<PmsServices> getServicesList(ServicesSearchForm form, Integer page, Integer pageSize);

	/**
	 * 发布商品
	 * @author wenlj
	 * @date   2023/10/03
	 * @param  shop
	 * @param  publishForm
	 * @throws ServiceException 业务异常
	 */
	void publishServices(UmsShop shop, ServicesPublishForm publishForm) throws ServiceException;

	/**
	 * 上架商品
	 * @author wenlj
	 * @date   2023/10/03
	 * @param  servicesIdList
	 */
	void shangjiaServices(List<Integer> servicesIdList);

	/**
	 * 下架商品
	 * @author wenlj
	 * @date   2023/10/03
	 * @param  servicesIdList
	 */
	void xiajiaServices(List<Integer> servicesIdList);

	/**
	 * 删除商品
	 * @author wenlj
	 * @date   2023/10/03
	 * @param  servicesIdList
	 */
	void deleteServices(List<Integer> servicesIdList);

	/**
	 * 商品详情
	 * @author wenlj
	 * @date   2023/10/03
	 * @param  servicesId
	 * @return PmsServices
	 */
	PmsServices getServices(Integer servicesId);

	/**
	 * 减库存
	 * @author wenlj
	 * @date   2022/5/5
	 * @param  skuId
	 * @param  num
	 */
	void reduceStock(Integer skuId, Integer num);

	/**
	 * 加库存
	 * @author wenlj
	 * @date   2022/5/5
	 * @param  skuId
	 * @param  num
	 */
	void addStock(Integer skuId, Integer num);

	/**
	 * 更新商品
	 * @author wenlj
	 * @date   2022/5/7
	 * @param  services
	 */
	void updateServices(PmsServices services);

	/**
	 * 获取商品详情
	 * @author wenlj
	 * @date   2022/5/13
	 * @param  servicesId
	 * @return ServicesResult
	 */
	ServicesResult getServicesResult(Integer servicesId);

	/**
	 * 获取商品的SKU组合
	 * @author wenlj
	 * @date   2022/5/16
	 * @param  servicesId
	 * @return ServicesSkuResult
	 */
	ServicesSkuResult getServicesSkuList(Integer servicesId);

	/**
	 * 获取商品SKU
	 * @author wenlj
	 * @date   2022/5/16
	 * @param  skuId
	 * @return PmsServicesSku
	 */
	PmsServicesSku getServicesSku(Integer skuId);

	/**
	 * 阶梯拼团规则
	 * @author wenlj
	 * @date   2022/5/16
	 * @param  servicesId
	 * @return List<PmsServicesGroup>
	 */
	List<PmsServicesGroup> getServicesGroupList(Integer servicesId);

	/**
	 * 获取阶梯拼团
	 * @author wenlj
	 * @date   2022/5/16
	 * @param  groupId
	 * @return PmsServicesGroup
	 */
	PmsServicesGroup getServicesGroup(Integer groupId);

	/**
	 * 库存列表
	 * @author wenlj
	 * @date   2022/9/18
	 * @param  form
	 * @param  page
	 * @param  pageSize
	 * @return List<ServicesStockResult>
	 */
	List<ServicesStockResult> getServicesStockList(ServicesSearchForm form, Integer page, Integer pageSize);

	/**
	 * 更新库存
	 * @author wenlj
	 * @date   2022/9/18
	 * @param  stockList
	 */
	void updateServicesStock(List<PmsServicesSku> stockList);

	/**
	 * 同步仓库库存
	 * @author wenlj
	 * @date   2022/9/18
	 */
	void synStock(Integer shopId);

	/**
	 * 查询导出商品列表
	 * @author wenlj
	 * @date   2022/10/31
	 * @param  form 查询表单
	 * @param  page 分页
	 * @param  pageSize 分页
	 * @return List<ServicesExportResult>
	 */
	List<ServicesExportResult> getExportList(ServicesSearchForm form, Integer page, Integer pageSize);

	/**
	 * 批量导入商品
	 * @author wenlj
	 * @date   2023/2/13
	 * @param  shop 店铺
	 * @param  freightId 运费模板ID
	 * @param  servicesList 商品列表
	 */
	void importServices(UmsShop shop, Integer freightId, List<ServicesImportForm> servicesList);
}